/*
 * helpers.h
 *
 *  Created on: 6/11/2012
 *      Author: cvan680
 */

#ifndef HELPERS_H_
#define HELPERS_H_

#include "voreen/core/ports/renderport.h"
#include "modules/flowreen/utils/flowmath.h"

namespace voreen {

class Helper {

private:
	Helper(){}

public:
	static GLubyte* renderArrowPlotTexture(tgt::vec2* flow, const tgt::vec2& textureSize, RenderPort& tempPort, const tgt::vec2& thresholds, int arrowSize, int arrowSpacing);
	static tgt::Texture* copyTargetToTexture(RenderPort& renderPort, const tgt::vec2& textureSize);
	static void beginOrthographicRendering(const tgt::ivec2& viewport);
	static void endOrthographicRendering();
	static GLuint buildArrowGridDisplayList(tgt::vec2* flow, const tgt::vec2& textureSize, const tgt::vec2& thresholds, GLuint arrowList_, int as, int asp);
	static void renderArrow(const tgt::mat3& transformation, float magnitude);
	static tgt::mat3 getTransformationMatrix(const tgt::vec2& r, const tgt::vec2& v, const float scaling);

	static float vecSize(tgt::vec2 v);
	static tgt::vec4 getColor(float m);



	static GLubyte* renderStreamlinesTexture(tgt::vec2* flow, const tgt::vec2& textureSize, int numberOfStreamlines);
};

}

#endif /* HELPERS_H_ */
